home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / lang / Python152_Src.lha / Python152_Source / Amiga_Misc / Docs / environment_module < prev    next >
Text File  |  1998-11-10  |  2KB  |  84 lines

  1.  
  2.  
  3.                             ENVIRONMENT MODULE
  4.  
  5.                      Irmen de Jong - irmen@bigfoot.com
  6.                                27 dec. 1996
  7.  
  8.  
  9. This  document  describes  the  builtin  module `environment'.  This module
  10. contains  a  set  of functions for managing environment variables.  Because
  11. the  module  is  not  defined  in  the  Python  docs  I  assume there is no
  12. requirement for it being Posix compliant or portable.  Hence I made a whole
  13. new  module,  which  is  Amiga-specific.   It  consists  of  the  following
  14. functions:
  15.  
  16. putenv
  17. ~~~~~~
  18.   Set global (ENV:) environment variable.
  19.  
  20.   Use:    putenv(str)
  21.     str: string of the form "name=value"
  22.     No returnvalue.
  23.  
  24. getenv
  25. ~~~~~~
  26.   Get value of global (ENV:) environment variable.
  27.  
  28.   Use:    value=getenv(name)
  29.     name: string which is the variable to get
  30.     Returns the value of the variable (string), or None if the var
  31.     doesn't exist.
  32.  
  33. setenv
  34. ~~~~~~
  35.   Set global (ENV:) environment variable.
  36.  
  37.   Use:    setenv(name,value,overwrite)
  38.     name: name of variable to set (string)
  39.     value: value for this var (string)
  40.     overwrite: boolean flag (0/1) indicating if the value
  41.                should be overwritten if the var already exists.
  42.     No returnvalue.
  43.  
  44. unsetenv
  45. ~~~~~~~~
  46.   Remove a global (ENV:) environment variable.
  47.  
  48.   Use:    unsetenv(name)
  49.     name: string which is the name of the var to remove
  50.     No returnvalue.
  51.  
  52. setvar
  53. ~~~~~~
  54.   See setenv, but works on local (shell) vars instead of global.
  55.  
  56.   Use:    setvar(name,value,overwrite)
  57.     see setenv
  58.  
  59. getvar
  60. ~~~~~~
  61.   See getenv, but works on local (shell) vars instead of global.
  62.  
  63.   Use:    getvar(name)
  64.     see getenv
  65.  
  66. unsetvar
  67. ~~~~~~~~
  68.   See unsetenv, but works on local (shell) vars only, not global.
  69.  
  70.   Use:    unsetvar(name)
  71.     see unsetenv
  72.  
  73.  
  74.  
  75. Note that empty environment variables ('' - the empty string) are accepted.
  76.  
  77. All  functions  are  implemented using the dos.library's variable calls, to
  78. keep code short (it's around 1Kb).
  79.  
  80.  
  81.  
  82. SEE ALSO:
  83.     amiga module: environment dictionaries and putenv() function
  84.